package com.ruoyi.job.service;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.job.domain.OaRecruit;
import com.ruoyi.job.mapper.OaRecruitMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 招聘需求Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-12-29
 */
@Service
public class OaRecruitServiceImpl implements IOaRecruitService 
{
    @Autowired
    private OaRecruitMapper oaRecruitMapper;

    /**
     * 查询招聘需求
     * 
     * @param id 招聘需求ID
     * @return 招聘需求
     */
    @Override
    public OaRecruit selectOaRecruitById(Long id)
    {
        return oaRecruitMapper.selectOaRecruitById(id);
    }

    /**
     * 查询招聘需求列表
     * 
     * @param oaRecruit 招聘需求
     * @return 招聘需求
     */
    @Override
    public List<OaRecruit> selectOaRecruitList(OaRecruit oaRecruit)
    {
        return oaRecruitMapper.selectOaRecruitList(oaRecruit);
    }

    /**
     * 新增招聘需求
     * 
     * @param oaRecruit 招聘需求
     * @return 结果
     */
    @Override
    public int insertOaRecruit(OaRecruit oaRecruit)
    {
        oaRecruit.setCreateTime(DateUtils.getNowDate());
        return oaRecruitMapper.insertOaRecruit(oaRecruit);
    }

    /**
     * 修改招聘需求
     * 
     * @param oaRecruit 招聘需求
     * @return 结果
     */
    @Override
    public int updateOaRecruit(OaRecruit oaRecruit)
    {
        return oaRecruitMapper.updateOaRecruit(oaRecruit);
    }

    /**
     * 批量删除招聘需求
     * 
     * @param ids 需要删除的招聘需求ID
     * @return 结果
     */
    @Override
    public int deleteOaRecruitByIds(Long[] ids)
    {
        return oaRecruitMapper.deleteOaRecruitByIds(ids);
    }

    /**
     * 删除招聘需求信息
     * 
     * @param id 招聘需求ID
     * @return 结果
     */
    @Override
    public int deleteOaRecruitById(Long id)
    {
        return oaRecruitMapper.deleteOaRecruitById(id);
    }
}
